diff options
Diffstat (limited to 'src/routes/(app)/invoice/[hash]/tip/+page.server.js')
| -rw-r--r-- | src/routes/(app)/invoice/[hash]/tip/+page.server.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/routes/(app)/invoice/[hash]/tip/+page.server.js b/src/routes/(app)/invoice/[hash]/tip/+page.server.js new file mode 100644 index 00000000..c78e5020 --- /dev/null +++ b/src/routes/(app)/invoice/[hash]/tip/+page.server.js @@ -0,0 +1,11 @@ +import invoice from '$lib/invoice'; +import { redirect } from '@sveltejs/kit'; + +export async function load({ parent }) { + let { invoice } = await parent(); + if (!invoice.amount) throw redirect(307, `/invoice/${invoice.id}`); +} + +export const actions = { + default: invoice +}; |
